import React, { useEffect, useState } from "react";
import BgImg2023 from "./bg2023.png";
import "./index.css";

function Page({ children }) {
  const [version, setVersion] = useState("");
  const [productName, setProductName] = useState("PT论坛");
  const [showVersion, setShowVersion] = useState(true);
  const [year, setYear] = useState(2025);


  return (
    <div
      className="page-background"
      style={{
        background: `url(${BgImg2023})`,
        backgroundSize: "cover",
        backgroundPositionY: "40%",
      }}
    >
      <div className="page-header">
        <a className="page-header-title">{productName}</a>
      </div>
      <div className="page-content">
        <div className="page-content-panel">{children}</div>
      </div>
      {showVersion && (
        <div className="page-footer">
          <div>Version: {version}</div>
          <div>
            Copyright &copy; 2014 - {year} Chaitin Tech. All Rights Reserved.
            PT论坛 版权所有
          </div>
        </div>
      )}
    </div>
    
  );
}

export default Page;